<%@ page language="java" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/usercenter/include/base_usercenter_pre_part.jsp"></jsp:include>
<script language="javascript" src="<%=request.getContextPath()%>/region/js/region.js"></script>
<div class="box_blue">
	<div class="box_title">
		编辑公司信息
		<input type="button" onclick="javascript:jtool.goto('<%=request.getContextPath()%>/usercenter/company/listCompanies.do');" value="返回列表" />
	</div>
	<form action="<%=request.getContextPath()%>/usercenter/company/saveCompany.do" method="post">
		<table width="100%">
			<s:hidden name="company.id" />
			<s:hidden name="company.user.id" />
			<s:textfield name="company.name" label="%{getText('name')}" cssClass="longinput" maxlength="100" required="true" />
			<tr>
				<td class="tdLabel">
					地址
					<span class="required">*</span>
				</td>
				<td>
					<s:if test="company!=null && company.region!=null && company.region.fullName!=null ">
						<s:property value="company.region.fullName" />
						<input type="button" value="更改" onclick="javascript:$('#region').show();" />
					</s:if>
					<div id="region" <s:if test="company!=null && company.region!=null && company.region.fullName!=null ">class="hidden"</s:if>>
						<input type="hidden" name="company.region.id" id="regionId" value="<s:property value="company.region.id"/>" />
						<font>省:<select name="province" onchange="javascript:getRegion('region', 'city',$(this).val())"></select> </font>
						<font class="hidden">市:<select name="city" onchange="javascript:getRegion('region', 'district',$(this).val())"></select> </font>
						<font class="hidden"> 区:<select name="district" onchange="javascript:$('#regionId').val($(this).val());"></select> </font>
					</div>
					<s:if test="company!=null && company.region!=null">
						<script>initRegion("region", "<s:property value="company.region.id"/>","province","city","district");</script>
					</s:if>
					<s:else>
						<script>getRegion("region", "province");</script>
					</s:else>
				</td>
			</tr>
			<s:textfield name="company.address" label="%{getText('address')}" cssClass="longinput" maxlength="100" required="true" />
			<s:textfield name="company.postcode" label="%{getText('postcode')}" required="true" />
			<s:textfield name="company.email" label="%{getText('email')}" required="true" />
			<s:textfield name="company.phone" label="%{getText('phone')}" required="true" />
			<s:textfield name="company.tel" label="%{getText('tel')}" required="true" />
			<s:textarea name="company.introduction" label="%{getText('introduction')}" rows="7" cssStyle="width:760px;" />
			<tr>
				<td></td>
				<td>
					<input type="submit" value="提交" class="btn_blue_2" />
				</td>
			</tr>
		</table>
	</form>
</div>
<jsp:include page="/usercenter/include/base_usercenter_last_part.jsp"></jsp:include>